<extend name="Layout/ins_popup" />
<block name="content">
	<div class="popup-frame">
		<input type="hidden" name="ajax" id="ajax" value="1">
		<div class="popup-header">
			<div class="pull-left">
				<h1>添加权限组</h1>
			</div>
			<div class="pull-right">
				<a id="save" class="btn" >确定</a>
				<a id="close" class="btn btn-cancel">关闭</a>
			</div>
		</div>
		<div class="popup-body">
			<div class="popup-body-scroll">
				<div class="popup-content">
					<form id="form_data" name="form_data"method="post" >
						<input type="hidden" name="ajax" id="ajax" value="0">
						<input type="hidden" name="opmode" id="opmode" value="add">
						<div class="layui-form-item">
							<label class="layui-form-label" for="name">名称*：</label>
							<div class="layui-input-block col-16">
								<input class="layui-input"  type="text" id="name" name="name" check="required" info="请输入名称">
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label" for="sort">排序：</label>
							<div class="layui-input-block col-10">
								<input class="layui-input"  type="text" id="sort" name="sort" >
							</div>
						</div>

						<div class="layui-form-item">
							<label class="layui-form-label" for="is_del">状态：</label>
							<div class="layui-input-block col-10">
								<select  class="layui-input" name="is_del" id="is_del">
									<option  value="0">启用</option>
									<option value="1">禁用</option>
								</select>
							</div>
						</div>
						<div class="layui-form-item">
							<label class="layui-form-label" for="remark" >备注：</label>
							<div class="layui-input-block" >
								<textarea class="layui-textarea" name="remark" id="remark" rows="5" class="col-xs-12" ></textarea>
							</div>
						</div>
					</form>
				</div>
			</div>
</block>
<block name="js">
	<script type="text/javascript">
		var index = parent.layer.getFrameIndex(window.name);
		layui.use('global', function() {
			var $ = layui.jquery;

			//保存后关闭
			$('#save').on('click', function() {
				send_form('form_data', '{:U("save")}', '', function(ret) {
					if (ret.status == 1) {
						layer.msg(ret.info, {
							time : 1200
						}, function() {
							parent.location.reload(true);
							parent.layer.close(index);
						});

					}
				});
			});

			//关闭iframe
			$('#close').click(function() {
				parent.layer.close(index);
			});

			$('#btn_select_pid').on('click', function() {
				winopen("{:U('winpop')}", 560, 470);
			});
		});

	</script>
</block>